#include "adddiritem.h"

AddDirItem::AddDirItem(QString id, QWidget *parent)
	: m_id(id), QWidget(parent) {
	ui.setupUi(this);

	initWidget();
}

AddDirItem::~AddDirItem() {
}

void AddDirItem::initWidget() {
	ui.lblTime->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
}

void AddDirItem::on_pbDelete_clicked() {
	Q_EMIT deleteAddDirSignal(m_id);
}

void AddDirItem::on_leDirName_editingFinished() {
	QString text = ui.leDirName->text();
	if (!text.isEmpty()) {
		Q_EMIT addDirSignal(m_id, text);
	}
}
